import easyocr
import torch

gpu_available = torch.cuda.is_available()
# 创建 Reader，指定语言列表
# 'ch_sim' = 简体中文, 'ja' = 日语, 'en' = 英文
reader = easyocr.Reader(['ch_sim', 'ja', 'en'], gpu=gpu_available)

img_path = r"C:\Users\33720\Desktop\4.jpg"

results = reader.readtext(img_path)

for (bbox, text, prob) in results:
    print(f"识别文字: {text}, 置信度: {prob:.2f}")
